<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2023/12/31
 * Time: 6:47
 */
namespace app\modules\wx\controllers;

use app\common\controllers\WebController;
use app\common\helper\HistoryHelper;
use app\common\service\Wx;
use app\modules\setting\models\yh\SetYhCcsj;
use app\modules\setting\models\yh\SetYhJbxx;
use sookie\auth\models\Adminuser;
use Yii;

class IndexController extends WebController
{
    public $debug = false;//调试接口
    public function actionIndex(){

    }


    public function actionAuth(){
        $app = Wx::getInstance();
        $oauth = $app->oauth;

        // 获取 OAuth 授权结果用户信息
        $user = $oauth->user();

        return $this->redirect(['index','openid'=>$user->getId()]);
    }

    public function actionBack(){
        $app = Wx::getInstance();
        $response = $app->server->serve();
        echo $response->send();exit();
    }
}